/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_vistemedical")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvVistemedical.findAll", query = "SELECT c FROM CvVistemedical c"),
    @NamedQuery(name = "CvVistemedical.findByIdvistemedical", query = "SELECT c FROM CvVistemedical c WHERE c.idvistemedical = :idvistemedical"),
    @NamedQuery(name = "CvVistemedical.findByDatevisite", query = "SELECT c FROM CvVistemedical c WHERE c.datevisite = :datevisite"),
    @NamedQuery(name = "CvVistemedical.findByNomevaluateur", query = "SELECT c FROM CvVistemedical c WHERE c.nomevaluateur = :nomevaluateur"),
    @NamedQuery(name = "CvVistemedical.findByDureedevaliditejour", query = "SELECT c FROM CvVistemedical c WHERE c.dureedevaliditejour = :dureedevaliditejour"),
    @NamedQuery(name = "CvVistemedical.findByScanficheevaluation", query = "SELECT c FROM CvVistemedical c WHERE c.scanficheevaluation = :scanficheevaluation"),
    @NamedQuery(name = "CvVistemedical.findByEtatdeladerniervisite", query = "SELECT c FROM CvVistemedical c WHERE c.etatdeladerniervisite = :etatdeladerniervisite")})
public class CvVistemedical implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idvistemedical")
    private Integer idvistemedical;
    @Basic(optional = false)
    @Column(name = "datevisite")
    @Temporal(TemporalType.DATE)
    private Date datevisite;
    @Column(name = "nomevaluateur")
    private String nomevaluateur;
    @Column(name = "dureedevaliditejour")
    private Integer dureedevaliditejour;
    @Column(name = "scanficheevaluation")
    private String scanficheevaluation;
    @Lob
    @Column(name = "commentaire")
    private String commentaire;
    @Column(name = "etatdeladerniervisite")
    private String etatdeladerniervisite;
    @JoinColumn(name = "idtypevisitemedicale", referencedColumnName = "idtypevisitemedicale")
    @ManyToOne(fetch = FetchType.LAZY)
    private CvTypevisitemedicale idtypevisitemedicale;
    @JoinColumn(name = "cv_travailleur_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTravailleur cvTravailleurId;

    public CvVistemedical() {
    }

    public CvVistemedical(Integer idvistemedical) {
        this.idvistemedical = idvistemedical;
    }

    public CvVistemedical(Integer idvistemedical, Date datevisite) {
        this.idvistemedical = idvistemedical;
        this.datevisite = datevisite;
    }

    public Integer getIdvistemedical() {
        return idvistemedical;
    }

    public void setIdvistemedical(Integer idvistemedical) {
        this.idvistemedical = idvistemedical;
    }

    public Date getDatevisite() {
        return datevisite;
    }

    public void setDatevisite(Date datevisite) {
        this.datevisite = datevisite;
    }

    public String getNomevaluateur() {
        return nomevaluateur;
    }

    public void setNomevaluateur(String nomevaluateur) {
        this.nomevaluateur = nomevaluateur;
    }

    public Integer getDureedevaliditejour() {
        return dureedevaliditejour;
    }

    public void setDureedevaliditejour(Integer dureedevaliditejour) {
        this.dureedevaliditejour = dureedevaliditejour;
    }

    public String getScanficheevaluation() {
        return scanficheevaluation;
    }

    public void setScanficheevaluation(String scanficheevaluation) {
        this.scanficheevaluation = scanficheevaluation;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public String getEtatdeladerniervisite() {
        return etatdeladerniervisite;
    }

    public void setEtatdeladerniervisite(String etatdeladerniervisite) {
        this.etatdeladerniervisite = etatdeladerniervisite;
    }

    public CvTypevisitemedicale getIdtypevisitemedicale() {
        return idtypevisitemedicale;
    }

    public void setIdtypevisitemedicale(CvTypevisitemedicale idtypevisitemedicale) {
        this.idtypevisitemedicale = idtypevisitemedicale;
    }

    public CvTravailleur getCvTravailleurId() {
        return cvTravailleurId;
    }

    public void setCvTravailleurId(CvTravailleur cvTravailleurId) {
        this.cvTravailleurId = cvTravailleurId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idvistemedical != null ? idvistemedical.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvVistemedical)) {
            return false;
        }
        CvVistemedical other = (CvVistemedical) object;
        if ((this.idvistemedical == null && other.idvistemedical != null) || (this.idvistemedical != null && !this.idvistemedical.equals(other.idvistemedical))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvVistemedical[ idvistemedical=" + idvistemedical + " ]";
    }
    
}
